﻿@model Hrm.Core.BlogPost
@{
    ViewBag.Title = "BlogItem";
}
<div id="content">
    <section id="topbar">
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <h1>博文</h1>
                </div>
                <div class="col-md-6 text-right">
                    <ul class="breadcrumb">
                        <li>
                            <a href="@Url.Action("Index")">首页</a>
                        </li>
                        <li>
                            <a href="@Url.Action("Blog")">博客</a>
                        </li>
                        <li class="active">博文</li>
                    </ul>
                </div>
            </div>
        </div>
    </section>
    <section class="white-bg blog-item">
        <div class="container">
            <div class="col-md-8">
                <div class="blog-post">
                    <h2 class="blog-post-title">@Model.Title</h2>
                    <div class="blog-meta">
                        <span class="date">
                            <a href="#">
                                <i class="fa fa-calendar"></i>
                                @Model.CreateDatetime
                            </a>
                        </span>
                        <span class="seperator">/</span>
                        <span class="author">
                            <a href="#">
                                <i class="fa fa-user"></i>
                                @Model.CreateUserCode
                            </a>
                        </span>
                        <span class="seperator">/</span>
                        <span class="category">
                            <a href="#">
                                @Model.Type
                            </a>
                        </span>
                        <span class="seperator">/</span>
                        <span class="comments">
                            <a href="#commentsAnchor">
                                <i class="fa fa-comments"></i>
                                @Model.BlogComments.Count 个评价
                            </a>
                        </span>
                    </div>
                    <div class="blog-post-content">
                        @Html.Raw(Model.Content)
                        <div class="blog-post-pager">
                            <ul class="pager">
                                <li class="previous">
                                    @{
                                        var preBlog = (Hrm.Core.BlogPost)ViewBag.PreBlog;
                                        if (preBlog != null)
                                        {
                                            <a href="@Url.Action("BlogItem", new { Id = @preBlog.Id })">
                                                <span aria-hidden="true">←</span>@preBlog.Title
                                            </a>
                                        }
                                    }
                                </li>
                                <li class="next">
                                    @{
                                        var nextBlog = (Hrm.Core.BlogPost)ViewBag.NextBlog;
                                        if (nextBlog != null)
                                        {
                                            <a href="@Url.Action("BlogItem", new { Id = @nextBlog.Id })">@nextBlog.Title<span aria-hidden="true">→</span></a>
                                        }
                                    }
                                </li>
                            </ul>
                        </div>
                        <div class="blog-post-comments mt30">
                            <div class="heading mt20 mb30">
                                <h3>评价</h3>
                                <a name="commentsAnchor" id="commentsAnchor">
                                </a>
                            </div>
                            <ul class="blog-post-comments-list">
                                @foreach (var item in Model.BlogComments)
                                {
                                    <li>
                                        <div class="comment">
                                            <div class="comment-author">
                                                @*<img class="comment-avatar" src="/img/avatars/3.jpg" alt="avatar">*@
                                                <strong>@item.CreateUserCode</strong>
                                            </div>
                                            <div class="comment-meta">
                                                <a href="#" title="#">@item.CreateDatetime</a>
                                            </div>
                                            <p class="comment-text">
                                                @item.CommentText
                                            </p>
                                            <div class="comment-reply">
                                                <a href="javascript:void(0);" class="btn btn-default btnReply"><i class="fa fa-reply"></i> Reply</a>
                                            </div>
                                        </div>
                                    </li>
                                }
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="sidebar sidebar-right col-md-4">
                @Html.Action("PartViewPopularBlogs")
                @Html.Action("PartViewTagsCloud")

            </div>
        </div>
    </section>
</div>
@section JavascriptSection{
    <script src="~/js/pages/blank.js"></script>
}

